<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <!--<iframe src="http://localhost:3000" id="ajax">  -->
</body>
<script>
    // iframe跨域，无法访问
    var iframe = document.createElement("iframe");
        iframe.src = "http://localhost:3000";
        iframe.id = "ajax";
        document.body.appendChild(iframe);
        var contentW;
        document.getElementById('ajax').onload = function(){  
            contentW = document.getElementById('ajax').contentWindow;  
        };

    // 1. 设置document.domain, document.domain 只能从子域设置到主域，往下设置以及往其他域名设置都是不允许的

</script>
</html>